class TopicModel {
  int _code;
  String _msg;
  TopicModelEntity _data;

  int get code => _code;

  String get msg => _msg;

  TopicModelEntity get data => _data;

  TopicModel({int code, String msg, TopicModelEntity data}) {
    _code = code;
    _msg = msg;
    _data = data;
  }

  TopicModel.fromJson(dynamic json) {
    _code = json["code"];
    _msg = json["msg"];
    _data =
        json["data"] != null ? TopicModelEntity.fromJson(json["data"]) : null;
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["code"] = _code;
    map["msg"] = _msg;
    if (_data != null) {
      map["data"] = _data.toJson();
    }
    return map;
  }
}

/// topicInfoVOs : [{"id":72,"name":"#品品这酒啥水平","description":"你品！你细品！任何时候都适合品酒，微醺了可以助眠，睡醒了可以继续品~","imgUrl":"https://image.xiajiucai.com/billionbottle/indexAsk/2020_04_05_2de49b7d_20f7_4854_9802_4149119d12ed_522x343.jpg","wineTalkNum":250,"leadingWords":"分享你的品酒经历","type":1,"totalOpenTimes":2907,"openTimes":1126,"robotOpenTimes":2907,"topicTypeFlag":1},{"id":41,"name":"#这个酒柜打几分？","description":"你的酒柜是什么样子的呢，收藏达人还是佛系玩家？精致酒鬼还是豪放酒徒？快来秀出你的私藏吧！","imgUrl":"https://image.xiajiucai.com/billionbottle/indexAsk/2020_04_05_ab6ffac7_3af7_450e_b914_2a2794df5ccf_1140x640.jpg","wineTalkNum":145,"leadingWords":"快晒出你的酒柜吧！","type":1,"totalOpenTimes":4434,"openTimes":1625,"robotOpenTimes":4434,"topicTypeFlag":1},{"id":400,"name":"#这波酒标绝了！","description":"酒标既是酒的身份证，也是酒的门面担当！你见过哪些绝美的酒标呢？快秀出来，有机会赢豪华酒水礼包哦~","imgUrl":"https://image.xiajiucai.com/billionbottle/indexAsk/2020_07_02_094f9abd_e1b9_4ab6_ae72_18470a79b845_12155x8338.jpg","wineTalkNum":122,"leadingWords":"这些让我入坑的酒标，真绝了！","type":2,"totalOpenTimes":2988,"openTimes":3594,"robotOpenTimes":2988,"topicTypeFlag":1},{"id":377,"name":"#酒圈人のVlog","description":"百瓶vlog红人榜来啦！以vlog的形式记录你每日饮酒的高光时刻，百瓶将每半月评选一次，不限期数！","imgUrl":"https://image.xiajiucai.com/billionbottle/indexAsk/2020_05_06_2b3b37c3_e938_4659_aa1d_d63ab530aab7_2917x2001.png","wineTalkNum":504,"leadingWords":"录制你的专属vlog，成为酒圈红人博主","type":2,"totalOpenTimes":5039,"openTimes":4207,"robotOpenTimes":5039,"topicTypeFlag":1}]
/// lastId : 20

class TopicModelEntity {
  List<TopicInfoVOs> _topicInfoVOs;
  int _lastId;

  List<TopicInfoVOs> get topicInfoVOs => _topicInfoVOs;

  int get lastId => _lastId;

  TopicModelEntity({List<TopicInfoVOs> topicInfoVOs, int lastId}) {
    _topicInfoVOs = topicInfoVOs;
    _lastId = lastId;
  }

  TopicModelEntity.fromJson(dynamic json) {
    if (json["topicInfoVOs"] != null) {
      _topicInfoVOs = [];
      json["topicInfoVOs"].forEach((v) {
        _topicInfoVOs.add(TopicInfoVOs.fromJson(v));
      });
    }
    _lastId = json["lastId"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    if (_topicInfoVOs != null) {
      map["topicInfoVOs"] = _topicInfoVOs.map((v) => v.toJson()).toList();
    }
    map["lastId"] = _lastId;
    return map;
  }
}

/// id : 72
/// name : "#品品这酒啥水平"
/// description : "你品！你细品！任何时候都适合品酒，微醺了可以助眠，睡醒了可以继续品~"
/// imgUrl : "https://image.xiajiucai.com/billionbottle/indexAsk/2020_04_05_2de49b7d_20f7_4854_9802_4149119d12ed_522x343.jpg"
/// wineTalkNum : 250
/// leadingWords : "分享你的品酒经历"
/// type : 1
/// totalOpenTimes : 2907
/// openTimes : 1126
/// robotOpenTimes : 2907
/// topicTypeFlag : 1

class TopicInfoVOs {
  int _id;
  String _name;
  String _description;
  String _imgUrl;
  int _wineTalkNum;
  String _leadingWords;
  int _type;
  int _totalOpenTimes;
  int _openTimes;
  int _robotOpenTimes;
  int _topicTypeFlag;

  int get id => _id;

  String get name => _name;

  String get description => _description;

  String get imgUrl => _imgUrl;

  int get wineTalkNum => _wineTalkNum;

  String get leadingWords => _leadingWords;

  int get type => _type;

  int get totalOpenTimes => _totalOpenTimes;

  int get openTimes => _openTimes;

  int get robotOpenTimes => _robotOpenTimes;

  int get topicTypeFlag => _topicTypeFlag;

  TopicInfoVOs(
      {int id,
      String name,
      String description,
      String imgUrl,
      int wineTalkNum,
      String leadingWords,
      int type,
      int totalOpenTimes,
      int openTimes,
      int robotOpenTimes,
      int topicTypeFlag}) {
    _id = id;
    _name = name;
    _description = description;
    _imgUrl = imgUrl;
    _wineTalkNum = wineTalkNum;
    _leadingWords = leadingWords;
    _type = type;
    _totalOpenTimes = totalOpenTimes;
    _openTimes = openTimes;
    _robotOpenTimes = robotOpenTimes;
    _topicTypeFlag = topicTypeFlag;
  }

  TopicInfoVOs.fromJson(dynamic json) {
    _id = json["id"];
    _name = json["name"];
    _description = json["description"];
    _imgUrl = json["imgUrl"];
    _wineTalkNum = json["wineTalkNum"];
    _leadingWords = json["leadingWords"];
    _type = json["type"];
    _totalOpenTimes = json["totalOpenTimes"];
    _openTimes = json["openTimes"];
    _robotOpenTimes = json["robotOpenTimes"];
    _topicTypeFlag = json["topicTypeFlag"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["id"] = _id;
    map["name"] = _name;
    map["description"] = _description;
    map["imgUrl"] = _imgUrl;
    map["wineTalkNum"] = _wineTalkNum;
    map["leadingWords"] = _leadingWords;
    map["type"] = _type;
    map["totalOpenTimes"] = _totalOpenTimes;
    map["openTimes"] = _openTimes;
    map["robotOpenTimes"] = _robotOpenTimes;
    map["topicTypeFlag"] = _topicTypeFlag;
    return map;
  }
}
